<template>
	<view class="physical-wrap" :data-theme="theme()">
		<view class="physical-title">
			<!-- 物流详情 -->
			<template v-if="detail.is_single==1">
				<view>{{ orderDeliver.express_name }}:{{ orderDeliver.express_no }}</view>
				<view class="base-order-copy" @click="copy(orderDeliver.express_no)">复制</view>
			</template>
			<template v-else>
				<view>{{ detail.express.express_name }}:{{ detail.express_no }}</view>
				<view class="base-order-copy" @click="copy(detail.express_no)">复制</view>
			</template>
		</view>
		<view class="step-wrap">
			<template v-for="(v,idx) in expressData" :key="idx">
				<view class="step-item" :class="{'active': idx == 0}">
					<view class="step-circle"></view>
					<view class="step-title">{{ v.status }} {{ v.time }}</view>
					<view class="step-desc">
						{{ v.context }}
					</view>
				</view>
			</template>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['expressData', 'detail', 'orderDeliver'],
		data() {
			return {};
		},
		methods: {
			/*复制*/
			copy(message) {
				console.log("message", message)
				uni.setClipboardData({
					data: message,
					success: function(res) {
						uni.showToast({
							title: '复制成功',
							icon: 'success',
							mask: true,
							duration: 2000
						});
					},
					fail: function(res) {
						console.log("error", res)
					}
				});
			}
		}
	};
</script>

<style lang="scss" scoped>
	.physical-wrap {
		background: #FFFFFF;
		margin-top: 25rpx;
		padding: 0 20rpx;
		border-radius: 25rpx;

		.physical-title {
			font-size: 26rpx;
			font-family: Source Han Sans CN;
			display: flex;
			justify-content: space-between;
			align-items: center;
			color: #666;
			padding: 20rpx 0;
			border-bottom: 1px solid #EEEEEE;

			.base-order-copy {
				font-size: 24rpx;
				display: inline-block;
				width: 88rpx;
				height: 42rpx;
				background: #FFFFFF;
				border-radius: 21rpx;
				border: 1px solid #EEEEEE;
				color: #333;
				line-height: 42rpx;
				text-align: center;
			}
		}

		.step-wrap {
			padding-top: 29rpx;
			padding-bottom: 34rpx;
		}

		.step-item {
			position: relative;
			padding-left: 40rpx;

			&::before {
				content: "";
				position: absolute;
				left: 10rpx;
				width: 2rpx;
				height: 100%;
				background: #999;
			}

			.step-circle {
				width: 20rpx;
				height: 20rpx;
				background: #999;
				border-radius: 10rpx;
				position: absolute;
				top: 0;
				left: 0;
			}

			.step-title {
				font-size: 29rpx;
				color: #979797;
			}

			.step-desc {
				padding: 18rpx 0;
				padding-bottom: 20rpx;
				color: #A7A7A7;
			}

			&.active {
				.step-circle {
					// background: #FF5704;
					@include background_color('background_color');
				}

				.step-title {
					// color: #FF5704;
					@include font_color('font_color');
					font-weight: bold;
					font-size: 30rpx;
				}

				.step-desc {
					color: #333;
				}
			}
		}
	}
</style>